<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>门店查询</title>
    <link rel="stylesheet" href="../../../yl/index.css" />
    <!-- 布局样式 -->
    <link rel="stylesheet" href="../../../yl/style.css">
    <link rel="stylesheet" href="../../../style/wangeditor.css">
    <link rel="stylesheet" href="../../../yl/mobile.css" />
    <link rel="stylesheet" href="../../../yl/easyui.css" />
    <link rel="stylesheet" href="../../../yl/icon.css" />
</head>

<body>
    <!-- <div id="app"> -->
    <div class="easyui-navpanel" id="app" v-cloak>
        <header>
            <div class="m-toolbar">
                <div class="m-title">{{action=='Add'?'添加房型':action=='Modify'?'修改房型':''}}</div>
            </div>
        </header>
        <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
            id="MainTable" ref="MainTable"
            :data-options="JSON.stringify({ 'TableName': 'room_type', 'form': 'dataForm' ,'primary_key':'Room_Type_SerialNumber' })">
            <div class="yl-main">
                <div class="table_titel">
                    <div class="titel">房型信息</div>
                </div>
                <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
                    <el-descriptions :column="3" size="large" border>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">房型名称</div>
                            </template>
                            <el-form-item prop="Room_Type_Name"
                                :rules="[{ required: true, message: '请输入房型名称', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Room_Type_Name" class="borderless-input"
                                    placeholder="请输入房型名称" />
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">房间面积</div>
                            </template>
                            <el-form-item prop="Room_Area_Size"
                                :rules="[{ required: true, message: '请输入房间面积', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Room_Area_Size" class="borderless-input"
                                    placeholder="请输入房间面积" />
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">房间层数</div>
                            </template>
                            <el-form-item prop="Room_Layer"
                                :rules="[{ required: true, message: '请输入房间层数', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Room_Layer" class="borderless-input"
                                    placeholder="请输入房间层数" />
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">房型房间数量</div>
                            </template>
                            <el-form-item prop="Room_Quantity"
                                :rules="[{ required: true, message: '请输入房型房间数量', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Room_Quantity" class="borderless-input"
                                    placeholder="请输入房型房间数量" />
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">最大入住人数</div>
                            </template>
                            <el-form-item prop="Max_Occupancy"
                                :rules="[{ required: true, message: '请输入最大入住人数', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Max_Occupancy" class="borderless-input"
                                    placeholder="请输入最大入住人数" />
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">床型配置</div>
                            </template>
                            <el-form-item prop="Bed_Config"
                                :rules="[{ required: true, message: '请输入床型配置', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Bed_Config" class="borderless-input"
                                    placeholder="请输入床型配置" />
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">窗户类型</div>
                            </template>
                            <el-form-item prop="Window_Type_SerialNumber"
                                :rules="[{ required: true, message: '请选择窗户类型', trigger: 'change' }]">
                                <el-select v-model.trim="dataForm.Window_Type_SerialNumber" placeholder="请选择窗户类型"
                                    filterable style="width: 100%">
                                    <el-option :label="item.Window_Type" :value="item.Window_Type_SerialNumber"
                                        v-for="(item,index) in window_type" :key="index"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">基础价格</div>
                            </template>
                            <el-form-item prop="Base_Price"
                                :rules="[{ required: true, message: '请输入基础价格', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Base_Price" class="borderless-input"
                                    placeholder="请输入基础价格" />
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">是否含早餐</div>
                            </template>
                            <el-form-item>
                                <el-switch v-model="dataForm.Is_Breakfast" active-text="是" inactive-text="否"
                                    active-value="1" inactive-value="0"></el-switch>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">是否有Wifi</div>
                            </template>
                            <el-form-item>
                                <el-switch v-model="dataForm.Is_Wifi" active-text="是" inactive-text="否"
                                    active-value="1" inactive-value="0"></el-switch>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">是否部分禁烟</div>
                            </template>
                            <el-form-item>
                                <el-switch v-model="dataForm.Is_Partial_Smoking_Ban" active-text="是" inactive-text="否"
                                    active-value="1" inactive-value="0"></el-switch>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item :span="3">
                            <template #label>
                                <div class="cell-item">房型标签</div>
                            </template>
                            <el-form-item prop="Room_Category_SerialNumber"
                                :rules="[{ required: true, message: '请选择房型标签', trigger: 'change' }]">
                                <el-select multiple clearable
                                    v-model.trim="dataForm.Room_Category_SerialNumber" placeholder="请选择房型标签" filterable
                                    style="width: 100%">
                                    <el-option v-for="(item,index) in room_category" :key="index"
                                        :label="item.Room_Category"
                                        :value="item.Room_Category_SerialNumber"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item :span="3">
                            <template #label>
                                <div class="cell-item">装修风格</div>
                            </template>
                            <el-form-item prop="Decoration_Style"
                                :rules="[{ required: true, message: '请输入装修风格', trigger: 'blur' }]">
                                <el-input type="textarea" :autosize="{ minRows: 5}"  v-model.trim="dataForm.Decoration_Style" class="borderless-input"
                                    placeholder="请输入装修风格" />
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item :span="3">
                            <template #label>
                                <div class="cell-item">房型描述</div>
                            </template>
                            <el-form-item>
                                <el-input type="textarea" :autosize="{ minRows: 5}" v-model="dataForm.Room_Description"
                                    class="borderless-input" placeholder="请输入房型描述" />
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item :span="3">
                            <template #label>
                                <div class="cell-item">入住须知</div>
                            </template>
                            <el-form-item prop="Check_In_Notice"
                                :rules="[{ required: true, message: '请输入入住须知', trigger: 'blur' }]">
                                <yl-text-editor v-model="dataForm.Check_In_Notice" placeholder="请输入入住须知"></yl-text-editor>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item :span="3">
                            <template #label>
                                <div class="cell-item">设施政策</div>
                            </template>
                            <el-form-item prop="Facility_Policy"
                                :rules="[{ required: true, message: '请输入设施政策', trigger: 'blur' }]">
                                <yl-text-editor v-model="dataForm.Facility_Policy" placeholder="请输入设施政策"></yl-text-editor>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">适用房间</div>
                            </template>
                            <el-form-item >
                                <el-select multiple clearable @change="changeRoom"
                                    v-model.trim="House_Room_SerialNumber" placeholder="请选择适用房间" filterable
                                    style="width: 100%">
                                    <el-option v-for="(item,index) in blue_plate_house_room" :key="index"
                                        :label="item.Room_SerialNumber"
                                        :value="item.House_Room_SerialNumber"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-descriptions-item>
                    </el-descriptions>
                </el-form>
                <div id="ChildTable">
                    <div class="table_titel">
                        <div class="titel">房型设施</div>
                        <div class="operation">
                            <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
                            <el-button type="danger" size="small" @click="handleRemove('childDataForm')">删除</el-button>
                        </div>
                    </div>
                    <el-form :model="{childDataForm:childDataForm.filter(i => i.Row_Status != '1')}" ref="form1"
                        :inline-message="true" style="width: 100%">
                        <el-descriptions :column="3" size="large" border
                            :data-options="JSON.stringify({ 'TableName': 'room_facility', 'form': 'childDataForm', 'ParentTableName': 'room_type'})"
                            v-for="(item,index) in childDataForm.filter(i => i.Row_Status != '1')" :key="index">
                            <el-descriptions-item>
                                <template #label>
                                    <div class="cell-item">设施类型</div>
                                </template>
                                <el-form-item :prop="'childDataForm.' + index  + '.Facility_Type_SerialNumber'"
                                    :rules="[{ required: true, message: '请选择设施类型', trigger: 'change' }]">
                                    <el-cascader v-model="item.Facility_Type_SerialNumber" placeholder="请选择设施类型"
                                        :options="room_facility_type" class="borderless-input" style="width: 100%;"
                                        :props="{ value:'Facility_Type_SerialNumber', label:'Facility_Name' , emitPath:false}"></el-cascader>
                                </el-form-item>
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template #label>
                                    <div class="cell-item">是否收费</div>
                                </template>
                                <el-form-item>
                                    <el-switch v-model="item.Is_Free" active-text="是" inactive-text="否" active-value="1"
                                        inactive-value="0"></el-switch>
                                </el-form-item>
                            </el-descriptions-item>
                        </el-descriptions>
                    </el-form>
                    <div class="table_titel">
                        <div class="titel">房型图片</div>
                        <div class="operation">
                            <div class="operation">
                                <el-button type="primary" size="small"
                                    @click="handleAdd('childDataForm1')">新增</el-button>
                                <el-button type="danger" size="small"
                                    @click="handleRemove('childDataForm1')">删除</el-button>
                            </div>
                        </div>
                    </div>
                    <el-form :model="{childDataForm1:childDataForm1.filter(i => i.Row_Status != '1')}" ref="form2"
                        :inline-message="true" style="width: 100%">
                        <el-descriptions :column="3" size="large" border
                            :data-options="JSON.stringify({ 'TableName': 'room_type_image', 'form': 'childDataForm1', 'ParentTableName': 'room_type'})"
                            v-for="(item,index) in childDataForm1.filter(i => i.Row_Status != '1')" :key="index">
                            <el-descriptions-item>
                                <template #label>
                                    <div class="cell-item">图片</div>
                                </template>
                                <el-form-item :rules="[{ required: true, message: '请上传图片', trigger: 'change' }]">
                                    <yl-upload v-model="item.Room_Type_Image_URL"></yl-upload>
                                </el-form-item>
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template #label>
                                    <div class="cell-item">图片类型</div>
                                </template>
                                <el-form-item :prop="'childDataForm1.' + index  + '.Room_Type_Image_Type'"
                                    :rules="[{ required: true, message: '请选择图片类型', trigger: 'change' }]">
                                    <el-select clearable v-model.trim="item.Room_Type_Image_Type" placeholder="请选择图片类型"
                                        filterable style="width: 100%">
                                        <el-option :label="item.Image_Category"
                                            :value="item.Image_Category_SerialNumber"
                                            v-for="(item,index) in image_category" :key="index"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-descriptions-item>
                        </el-descriptions>
                    </el-form>
                    <el-descriptions
                    :data-options="JSON.stringify({ 'TableName': 'room_type_detail', 'form': 'childDataForm2', 'ParentTableName': 'room_type'})"></el-descriptions>
                </div>
            </div>
        </div>
        <footer class="botton-ann">
            <el-button @click="goBack">返回</el-button>
            <el-button type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
        </footer>
    </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/compressor.js"></script>
<script src="../../../utils/wangeditor.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/add1.js"></script>

</html>